package com.coocaa.ops.api.base.third.dmp.feign;

import com.coocaa.ops.api.base.properties.HostProperties;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;

/**
 * @author tangminghong
 * @date 2020-09-04
 */
public class DmpFeignClientService {

    @Setter
    private DmpFeignClient feignClient;

    @Autowired
    private HostProperties hostProperties;

    public String getDmpCrowd(Map<String, String> headers, Map<String, String> data) {
        try {
            return feignClient.getDmpCrowd(
                    new URI(hostProperties.getDmp()),
                    headers, data);
        } catch (URISyntaxException e) {
            return "";
        }
    }
}
